﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/login.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body>
    <div id="searchPage"></div>
    <div style="margin-top: 20px;" class="main">
        <div ng-app="myApp" class="wrap">
            <div class="togglebar">
                <ul class="nav nav-tabs nav-justified">
                    <li class="active"><a id="popNotsellbox">自主下架</a></li>
                    <li><a id="popNotselledbox">已下架</a></li>
                </ul>
            </div>
            <div style="margin-top: 5px;"></div>
            <div id="notsell-box">
                <table ng-controller="selfCancelCtrl" class="table table-hover">
                    <tr>
                        <td>企业赞助书中的活动名称</td>
                        <td>发布状态</td>
                        <td>发布时间</td>
                        <td>下架原因</td>
                        <td>下架</td>
                    </tr>
                    <tr ng-repeat="x in names">
                        <td>{{x.ProjectName}}</td>
                        <td>{{x.Status=='1'?"发布中":"审核中"}}</td>
                        <td>{{x.CreateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>  
                        <td>
                            <select class="form-control" id="ddlReason{{x.ProjectNO}}">
                                <option value="900000034">活动信息错误</option>
                                <option value="900000035">活动长时间没收到邀请</option>
                                <option value="900000036">活动需要重新发布</option>
                                <option value="900000037">活动已达成目的</option>
                                <option value="900000038">活动时间过期</option>
                                <option value="900000039">用户自主下架</option>
                            </select>
                        </td>
                        <td>
                            <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" onclick="Go(this)">下架</button>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="notselled-box">
                <table ng-controller="cancelledCtrl" class="table table-hover">
                    <tr>
                        <td>企业赞助书中的活动名称</td>
                        <td>下架状态</td>
                        <td>下架原因</td>
                        <!--<td>下架方</td>-->
                        <td>下架时间</td>
                    </tr>
                    <tr ng-repeat="x in names">
                        <td>{{x.ProjectName}}</td>
                        <td>{{x.Status=='5'?"已下架":"未下架"}}</td>
                        <td>{{x.Remark}}</td>
                        <!--<td>{{x.StartTime>new Date() ?'用户':'过期'}}</td>-->
                        <!--<td> {{today}} </td>-->
                        <td>{{x.UpdateTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Spon");
    });

    function AfteAjax(ctx) {

        if (ctx == "" || ctx == null) {
            $('#divError').html("").append("提交错误，请重试！");
            return;
        }

        window.location = "notsell.html";
    }

    function Go(obj) {

        var id = $(obj).attr("tag");
        var reason = $("#ddlReason" + id).val();

        common.commonAjax({ type: 'get', url: '../api/project/CancelActivity?id=' + id + "&reason=" + reason, sMethod: AfteAjax });
    }

</script>